package com.probiz.estore.common.model.content.base;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.common.model.content.RelatedContent;
import com.probiz.estore.core.model.BaseObject;

/**
 * ContentRelatedType Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class ContentRelatedTypeTbl extends BaseObject implements Serializable {

    protected Integer contentRelatedTypeId;
	protected String relatedTitle;
	protected String typeName;
	protected Integer ruleCode;
	protected Short autoEval;
	protected Short status;
	protected String templatePath;
	protected Short isSystem;
	protected Short isApplyToContent;
	protected Short isApplyToCategory;
	protected Integer version;

	protected Set<RelatedContent> relatedContents = new HashSet<RelatedContent>();

	/**
	 * Default Empty Constructor for class ContentRelatedType
	 */
	public ContentRelatedTypeTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class ContentRelatedType
	 */
	public ContentRelatedTypeTbl (
		 Integer in_contentRelatedTypeId
        ) {
		this.setContentRelatedTypeId(in_contentRelatedTypeId);
    }


	public Set<RelatedContent> getRelatedContents() {
		return relatedContents;
	}

	public void setRelatedContents(Set<RelatedContent> relatedContents) {
		this.relatedContents = relatedContents;
	}

	/**
	 * 	 * @return Integer
     * @hibernate.id column="contentRelatedTypeId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getContentRelatedTypeId() {
		return this.contentRelatedTypeId;
	}
	
	/**
	 * Set the contentRelatedTypeId
	 */	
	public void setContentRelatedTypeId(Integer aValue) {
		this.contentRelatedTypeId = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="relatedTitle" type="java.lang.String" length="128" not-null="false" unique="false"
	 */
	public String getRelatedTitle() {
		return this.relatedTitle;
	}
	
	/**
	 * Set the relatedTitle
	 */	
	public void setRelatedTitle(String aValue) {
		this.relatedTitle = aValue;
	}	

	/**
	 * 关联的名称	 * @return String
	 * @hibernate.property column="typeName" type="java.lang.String" length="64" not-null="true" unique="false"
	 */
	public String getTypeName() {
		return this.typeName;
	}
	
	/**
	 * Set the typeName
	 * @spring.validator type="required"
	 */	
	public void setTypeName(String aValue) {
		this.typeName = aValue;
	}	

	/**
	 * 关联的代码.	 * @return Integer
	 * @hibernate.property column="ruleCode" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getRuleCode() {
		return this.ruleCode;
	}
	
	/**
	 * Set the ruleCode
	 */	
	public void setRuleCode(Integer aValue) {
		this.ruleCode = aValue;
	}	

	/**
	 * 	 * @return Short
	 * @hibernate.property column="autoEval" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getAutoEval() {
		return this.autoEval;
	}
	
	/**
	 * Set the autoEval
	 * @spring.validator type="required"
	 */	
	public void setAutoEval(Short aValue) {
		this.autoEval = aValue;
	}	

	/**
	 * 	 * @return Short
	 * @hibernate.property column="status" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getStatus() {
		return this.status;
	}
	
	/**
	 * Set the status
	 * @spring.validator type="required"
	 */	
	public void setStatus(Short aValue) {
		this.status = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="templatePath" type="java.lang.String" length="128" not-null="false" unique="false"
	 */
	public String getTemplatePath() {
		return this.templatePath;
	}
	
	/**
	 * Set the templatePath
	 */	
	public void setTemplatePath(String aValue) {
		this.templatePath = aValue;
	}	

	/**
	 * 是否系统定义的	 * @return Short
	 * @hibernate.property column="isSystem" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getIsSystem() {
		return this.isSystem;
	}
	
	/**
	 * Set the isSystem
	 * @spring.validator type="required"
	 */	
	public void setIsSystem(Short aValue) {
		this.isSystem = aValue;
	}	

	/**
	 * 只应用到文章上	 * @return Short
	 * @hibernate.property column="isApplyToContent" type="java.lang.Short" length="5" not-null="false" unique="false"
	 */
	public Short getIsApplyToContent() {
		return this.isApplyToContent;
	}
	
	/**
	 * Set the isApplyToContent
	 */	
	public void setIsApplyToContent(Short aValue) {
		this.isApplyToContent = aValue;
	}	

	/**
	 * 只应用到目录上.	 * @return Short
	 * @hibernate.property column="isApplyToCategory" type="java.lang.Short" length="5" not-null="false" unique="false"
	 */
	public Short getIsApplyToCategory() {
		return this.isApplyToCategory;
	}
	
	/**
	 * Set the isApplyToCategory
	 */	
	public void setIsApplyToCategory(Short aValue) {
		this.isApplyToCategory = aValue;
	}	

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof ContentRelatedTypeTbl)) {
			return false;
		}
		ContentRelatedTypeTbl rhs = (ContentRelatedTypeTbl) object;
		return new EqualsBuilder()
				.append(this.contentRelatedTypeId, rhs.contentRelatedTypeId)
				.append(this.relatedTitle, rhs.relatedTitle)
				.append(this.typeName, rhs.typeName)
				.append(this.ruleCode, rhs.ruleCode)
				.append(this.autoEval, rhs.autoEval)
				.append(this.status, rhs.status)
				.append(this.templatePath, rhs.templatePath)
				.append(this.isSystem, rhs.isSystem)
				.append(this.isApplyToContent, rhs.isApplyToContent)
				.append(this.isApplyToCategory, rhs.isApplyToCategory)
				.append(this.version, rhs.version)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.contentRelatedTypeId) 
				.append(this.relatedTitle) 
				.append(this.typeName) 
				.append(this.ruleCode) 
				.append(this.autoEval) 
				.append(this.status) 
				.append(this.templatePath) 
				.append(this.isSystem) 
				.append(this.isApplyToContent) 
				.append(this.isApplyToCategory) 
				.append(this.version) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("contentRelatedTypeId", this.contentRelatedTypeId) 
				.append("relatedTitle", this.relatedTitle) 
				.append("typeName", this.typeName) 
				.append("ruleCode", this.ruleCode) 
				.append("autoEval", this.autoEval) 
				.append("status", this.status) 
				.append("templatePath", this.templatePath) 
				.append("isSystem", this.isSystem) 
				.append("isApplyToContent", this.isApplyToContent) 
				.append("isApplyToCategory", this.isApplyToCategory) 
				.append("version", this.version) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "contentRelatedTypeId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return contentRelatedTypeId;
	}

}